<!DOCTYPE html>
<!-- saved from url=(0078)http://47.97.127.120/esb-monitor/report/mamagement/systemMonitoring?lang=zh_CN -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<title>系统监控</title>
 
<link href="../../plugins/bootstrap-3.3.5-dist/css/bootstrap.min.css" rel="stylesheet" type="text/css">
<link href="../../plugins/perfect-scrollbar/css/perfect-scrollbar.min.css" rel="stylesheet">
<link href="../../plugins/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="../../css/Servicehomepage.css" rel="stylesheet">

<style>
.popover-title-success{
  	background-color: #d6e9c6;
    border-bottom: 1px solid #ebebeb;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    margin: 0;
    padding: 8px 14px;
}

.popover-title-fail{
  	background-color: #ebccd1;
    border-bottom: 1px solid #ebebeb;
    border-radius: 5px 5px 0 0;
    font-size: 14px;
    margin: 0;
    padding: 8px 14px;
}
.panel-success,.panel-danger{
 cursor:pointer
}
</style>
<link rel="stylesheet" href="./layer(1).css" id="layuicss-skinlayercss"></head>

<body>

<div id="alert"></div>
	<div style=" position: absolute;  top: 50%;  left: 50%;transform: translate(-50%, -50%); z-index:99;">
	<img id="serverLoading" src="./loading-0.gif" style="display: none;">
</div>

	<div class="Contents clear">
		<ol class="breadcrumb">
			<li class="active"> <i class="ics"></i>平台监控</li>
			<li class="active"> <i class="ics"></i>系统监控</li>
		</ol>
		<i class="line" style="margin-bottom: 20px;"></i>
	</div>

	<div id="myCarousel" class="carousel slide" style="min-height:25em;width:95%;margin:auto">
		<!-- 轮播（Carousel）项目 -->
		<div id="carousel-inner" class="carousel-inner"><div class="item active" id="item0"><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel0" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP0">qq</p><p class="text-center" style=" font-size:1em;">00222</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel1" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP1">MES</p><p class="text-center" style=" font-size:1em;">01001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel2" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP2">TDM</p><p class="text-center" style=" font-size:1em;">01002</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel3" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP3">BI</p><p class="text-center" style=" font-size:1em;">01003</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel4" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP4">SCM</p><p class="text-center" style=" font-size:1em;">01004</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel5" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP5">HR</p><p class="text-center" style=" font-size:1em;">01006</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel6" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP6">OA-XUEBAO</p><p class="text-center" style=" font-size:1em;">01008</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel7" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP7">SRM</p><p class="text-center" style=" font-size:1em;">02001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel8" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP8">SRM2</p><p class="text-center" style=" font-size:1em;">02002</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel9" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP9">MDM</p><p class="text-center" style=" font-size:1em;">03001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel10" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP10">CRM</p><p class="text-center" style=" font-size:1em;">03003</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel11" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP11">DMS</p><p class="text-center" style=" font-size:1em;">04001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel12" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP12">OA</p><p class="text-center" style=" font-size:1em;">04002</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel13" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP13">WMS</p><p class="text-center" style=" font-size:1em;">04003</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel14" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP14">CAD</p><p class="text-center" style=" font-size:1em;">05001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel15" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP15">PDM</p><p class="text-center" style=" font-size:1em;">06001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel16" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title="" aria-describedby="popover408028"> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP16">mqtt</p><p class="text-center" style=" font-size:1em;">06002</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel17" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP17">OPC</p><p class="text-center" style=" font-size:1em;">06003</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel18" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP18">ERP</p><p class="text-center" style=" font-size:1em;">06006</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel19" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP19">ERP</p><p class="text-center" style=" font-size:1em;">07001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel20" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP20">BOM</p><p class="text-center" style=" font-size:1em;">08001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel21" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP21">LBS</p><p class="text-center" style=" font-size:1em;">09001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel22" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP22">HCM</p><p class="text-center" style=" font-size:1em;">10001</p></div></div></div></div><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel23" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP23">测试系统</p><p class="text-center" style=" font-size:1em;">1111</p></div></div></div></div></div><div class="item" id="item1"><div class="col-xs-12 col-sm-3 col-md-2 "> <div id="panel24" class="panel panel-default panel-stat" data-toggle="popover" data-original-title="" title=""> <div class="panel-heading"><div class="stat" style="height: 5em; "><p class="text-center" style="  font-size:1.5em;" id="itemP24">opcrest</p><p class="text-center" style=" font-size:1em;">16005</p></div></div></div></div></div></div>
	</div>


	<script src="../../js/jquery-2.2.4.js"></script>
	<script src="../../js/cookie.js"></script>
	<script src="../../plugins/bootstrap-3.3.5-dist/js/bootstrap.min.js"></script>
	<script src="../../js/reportCommon.js"></script>
	<script src="../../js/prompt.js"></script>	
	<script src="../../plugins/echarts/echarts.min.js"></script>
	<script src="../../plugins/layer/layer.js"></script>
	<script src="../../plugins/perfect-scrollbar/js/perfect-scrollbar.jquery.min.js"></script>
	 


<script>
var config={};
var i18n= getCookie("org.springframework.web.servlet.i18n.CookieLocaleResolver.LOCALE");

$(function() {
	$.getJSON("../../config/monitor-config.json",function(data){
		config =data;
    
	    SystemMonitoringToday();
	
	    setInterval(function() { 	 
	        SystemMonitoringToday();
	    },
	    (config.mamagement.systemMonitoring.intervaltime||10)*1000);
	});
});
 var start;
 var end;
 var startTime;
 var endTime;
 var success=new Array();
 var fail=new Array();
 var a=0;
function SystemMonitoringToday() {

    var now = new Date();
    var before=new Date(now - (config.mamagement.systemMonitoring.betweentime||15)*60 * 1000) ;
	startTime=getNowFormatDate(before);
	endTime= getNowFormatDate(now);
	start=  bitsAdd0(before.getHours()) + ":" + bitsAdd0(before.getMinutes())+":" + bitsAdd0(before.getSeconds());
	end =bitsAdd0(now.getHours()) + ":" + bitsAdd0(now.getMinutes())+":" + bitsAdd0(now.getSeconds());
    $.ajax({
        url: '../../report/systemMonitoringData',
        type: 'post',
        dataType: 'json',
        data: {
            startTime:startTime,
            endTime: endTime
        },
        timeout: (config.mamagement.systemMonitoring.timeout||10)*1000,
        error: function(XMLHttpRequest, textStatus, errorThrown) {
        	$("#system").alert('close');
            $('#serverLoading').css("display", "none");
            promptError($('#alert'), XMLHttpRequest, textStatus,"system");
        },
        success: function(result) {
        	$("#system").alert('close');
            $('#serverLoading').css("display", "none");
            if (result.code == '0') {
                var len = result.data.length;
                if (len > 0) {
                
                    for (var i = 0; i < len; i++) {
                        var itemnumber = parseInt(i / 24);
                        var itemlen = $('#item' + itemnumber).text().trim().length;
                        //判断页面是否有item（无创建）
                        if (itemlen == 0) { //创建
                            if (itemnumber == 0) {

                                $('#carousel-inner').append('<div class="item active" id="item' + itemnumber + '"></div>');
                            } else {

                                $('#carousel-inner').append('<div class="item" id="item' + itemnumber + '"></div>');
                            }
                            $("#myCarousel").carousel({
                                interval: 3000
                            });
                        }
                        var itemPlen = $('#itemP' + i).text().trim().length;
						
                        if (itemPlen == 0) { //创建
                            $('#item' + itemnumber).append('<div class="col-xs-12 col-sm-3 col-md-2 ">'+
                            ' <div id="panel' + i + '" class="panel panel-success panel-stat" data-toggle="popover" >'
                             + ' <div class="panel-heading"><div class="stat"  style="height: 5em; ">' + '<p class="text-center" style="  font-size:1.5em;" id="itemP' + i + '">' 
                             + result.data[i].sysAbbreviation + '</p><p class="text-center" style=" font-size:1em;">' + result.data[i].sysId + '</p></div></div></div></div>');	                                 
                    		
                    		success.push(result.data[i].success||0);
                    		fail.push(result.data[i].fail||0);
                    		
                    		$('#panel' + i).popover({ //初始化        
				                html: true,  
				                title:function(){
				                	return start+'-'+end;
				                },
				                trigger: "hover",			                
				                container: "body",
				                placement: "bottom",			               
				                content: function(){	
				                	var i= $(this).attr("id").substring(5);        	               			                
					                return '成功次数:'+success[i] +'</br>失败次数:'+fail[i];		               	               			                
				                },
			            });  
                    		 
	                     } else{
	                     	success[i]=result.data[i].success||0;
	                     	fail[i]=result.data[i].fail||0;
	                     	 
	                     }

                        if (fail[i] >0) {
                        	 
                            $('#panel' + i).removeClass().addClass('panel panel-danger panel-stat');
                        } else if(success[i] >0){

                            $('#panel' + i).removeClass().addClass('panel panel-success panel-stat');
                        }else{                      
                        	 $('#panel' + i).removeClass().addClass('panel panel-default panel-stat');
                        }                                                                  
                    }
                    
                    if(a==0){
                    	a=1;
                    	$("[data-toggle='popover']").mouseover(function(){//改变头的背景
                   		var tootipid=$(this).attr("aria-describedby");
                   		 
                   		var panel_class= $(this).attr("class");
                   		 
                   		if(panel_class.indexOf("danger") > -1){
                   		 
                   			$("#"+tootipid).children(".popover-title").removeClass().addClass('popover-title-fail');
                   		}else if(panel_class.indexOf("success") > -1){
                   		
                   			$("#"+tootipid).children(".popover-title").removeClass().addClass('popover-title-success');                  			 
                   		}else{                  		
                   			 $("#"+tootipid).children(".popover-title").removeClass().addClass('popover-title');
                   		}                         		               		                		
                   }); 
                   
                    $("[data-toggle='popover']").click(function(){ 
                   		var panel_class= $(this).attr("class");
                     	 
                     	if(panel_class.indexOf("default") == -1){//有交易
                     		var sysId= $(this).find("p:eq(1)").text();
                     		var sysName= $(this).find("p:eq(0)").text();
                     		 
               		     	 layer.open({
               		     		  title:sysName+"("+sysId+")",
               		     		  area: ['100%', '100%'],
								  type: 2,
								  content: '../general/systemMonitoring/service?sysId='+sysId+"&startTime="+startTime+"&endTime="+endTime+'&lang='+i18n,							 
								});
							   
                   		 }              		               		                		
                   });  
                    
                    }
       
                } else {
                    promptInformation($("#alert"), 3, '平台暂无可用系统');
                }
            }
        }
    });
}
 

	</script>



<div class="popover fade bottom in" role="tooltip" id="popover408028" style="top: 409px; left: 775.789px; display: block;"><div class="arrow" style="left: 50%;"></div><h3 class="popover-title">17:27:23-17:42:23</h3><div class="popover-content">成功次数:0<br>失败次数:0</div></div></body></html>